home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
fielddh.exe
/
FIELDS_C.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-04-30
|
26KB
|
685 lines
{*************************************************}
{ }
{ Turbo Pascal 6.0 }
{ Turbo Vision Forms Demo }
{ Copyright (c) 1990 by Borland International }
{*************************************************}
{ }
{ Original by BI, my additions are FREEWARE }
{ Doug Hood CIS 70324,3336 }
{ }
{*************************************************}
{ Original Allows for }
{ 1: non-blank input lines! }
{ 2: ranged integer fields! }
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{ DWH: added Err_Msg String }
{ added COLORS to buttons/static/input text}
{ added NoEcho fields (for passwords) }
{ added UPPERCASE input lines }
{ added centered input lines }
{ added drive input lines }
{ added path input lines }
{ }
{*************************************************}
unit Fields_Color;
{$F+,O+,X+,S-,D-}
interface
uses Objects, Drivers, Dialogs, Views,
Color_App; {color Buttons/Text, dialogs, and field support}
type
{*************************************************************************}
{* TInputLine (TVision) *}
{* | *}
{* + Color_InputLine (in unit COLOR_APP) *}
{* | *}
{* + TKeyInputLine (can be invalid if empty) *}
{* | *}
{* + TUpper_InputLine *}
{* | | *}
{* | + TCentered_InputLine *}
{* | | *}
{* | + TPath_InputLine *}
{* | | *}
{* | + TDrive_InputLine *}
{* | | *}
{* | + TNoEcho_InputLine *}
{* | | *}
{* | + TDate_InputLine *}
{* | *}
{* + TNumInputLine *}
{*************************************************************************}
{*------------------------------------------------*}
{ Same as Color_InputLine, except invalid if empty }
{*------------------------------------------------*}
PKeyInputLine = ^TKeyInputLine;
TKeyInputLine = object(COLOR_APP.Color_InputLine)
IsValid : boolean;
Blank_Is_Allowed : boolean;
constructor Init(var Bounds: TRect; AMaxLen: Integer;
Color_Id : word; {0=use default}
Empty_Allowed : boolean);
function Valid(Command: Word): Boolean; virtual;
procedure HandleEvent (var Event : TEvent); virtual;
function GetPalette: PPalette; VIRTUAL; {for change color on error}
end; {tkeyinputline}
{*-------------------------------------------------*}
{ Same as TKeyInputLine, except can force UPPERCASE }
{*-------------------------------------------------*}
PUpper_InputLine = ^TUpper_InputLine;
TUpper_InputLine = object(TKeyInputLine)
Force_UpperCase : boolean;
constructor Init(var Bounds: TRect; AMaxLen: Integer;
Color_Id : word; {0=use default}
Empty_Allowed : boolean;
Force_To_Uppercase : boolean);
procedure HandleEvent (var Event : TEvent); virtual;
end; {tupper_inputline}
{*--------------------------------------------------------------*}
{ Same as TUpper_InputLine, except centers string as its entered }
{*--------------------------------------------------------------*}
PCentered_InputLine = ^TCentered_InputLine;
TCentered_InputLine = object(TUpper_InputLine)
Left_Justify_Allowed : boolean; {whether to look for ^LJ}
constructor Init(var Bounds: TRect; AMaxLen: Integer;
Color_Id : word; {0=use default}
Empty_Allowed : boolean;
Force_To_Uppercase : boolean;
Allow_Left_Justify : boolean); {^LJ}
procedure HandleEvent (var Event : TEvent); virtual;
procedure SetData(var Rec); virtual;
end; {tcentered_inputline}
{*--------------------------------------------------------------*}
{ Same as TUpper_InputLine, except expects full path syntax }
{ also checks if path exists and warns user if it doesnt }
{*--------------------------------------------------------------*}
PPath_InputLine = ^TPath_InputLine;
TPath_InputLine = object(TUpper_InputLine)
function Valid(Command: Word): Boolean; virtual;
end; {tpath_inputline}
{*--------------------------------------------------------------*}
{ Same as TUpper_InputLine, except expects a drive letter }
{ also checks if drive exists and warns user if it doesnt }
{*--------------------------------------------------------------*}
PDrive_InputLine = ^TDrive_InputLine;
TDrive_InputLine = object(TUpper_InputLine)
Bytes_Free_Req : LongInt;
constructor Init(var Bounds: TRect; AMaxLen: Integer;
Color_Id : word; {0=use default}
Empty_Allowed : boolean;
Force_To_Uppercase : boolean;
Num_Disk_Bytes_Required : LongInt); {0=dont care}
function Valid(Command: Word): Boolean; virtual;
end; {tdrive_inputline}
{*---------------------------------------------------*}
{ Same as TInputLine, except writes '*' for each char }
{ [very useful for passwords] }
{*---------------------------------------------------*}
PNoEcho_InputLine = ^TNoEcho_InputLine;
TNoEcho_InputLine = object(TUPPER_InputLine)
procedure Draw; virtual;
end; {tnoecho_inputline}
{*----------------------------------------------------*}
{ Accepts only valid numeric input between Min and Max }
{*----------------------------------------------------*}
PNumInputLine = ^TNumInputLine;
TNumInputLine = object (TKeyInputLine)
Min: Longint;
Max: Longint;
Err_Msg_String : string[80];
constructor Init(var Bounds: TRect; AMaxLen: Integer;
Color_Id : word; {0=use default}
Empty_Allowed : boolean;
AMin, AMax: Longint;
Err_Msg_Start : string);
constructor Load(var S: TStream);
function DataSize: Word; virtual;
procedure GetData(var Rec); virtual;
procedure SetData(var Rec); virtual;
procedure Store(var S: TStream);
function Valid(Command: Word): Boolean; virtual;
end; {tnuminputline}
{*--------------------------------------------------------------*}
{ Same as TUpper_InputLine, except expects date syntax }
{ also checks if date exists and warns user if it doesnt }
{*--------------------------------------------------------------*}
PDate_InputLine = ^TDate_InputLine;
TDate_InputLine = object(TUpper_InputLine)
Month, Day, Year : word;
function Valid(Command: Word): Boolean; virtual;
constructor Init (var Bounds: TRect